/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vehicles;

/**
 * A JavaBean that represents a Car.
 * 
 * @author jonesbr
 */
public class Car {
    
    private int odometer;
    private int tripOdometer;
    private double gallonsOfGas;
    private int milesPerGallon;

    /**
     * Move the car a specified distance
     * 
     * @param distance the distance we wish to move the car.
     */
    public void go(int distance) {
        // compute the gallons of gas used.
        double gallonsOfGasUsed = distance/milesPerGallon;
        
        // subtract the gallons used from the gallons available.
        gallonsOfGas = gallonsOfGas - gallonsOfGasUsed;
        
        // increase the odometer.
        odometer = odometer + distance;
        
        // increase the trip odometer.
        tripOdometer += distance;
    }
    
    /**
     * @return the odometer
     */
    public int getOdometer() {
        return odometer;
    }

    /**
     * @param odometer the odometer to set
     */
    public void setOdometer(int odometer) {
        this.odometer = odometer;
    }

    /**
     * @return the tripOdometer
     */
    public int getTripOdometer() {
        return tripOdometer;
    }

    /**
     * @param tripOdometer the tripOdometer to set
     */
    public void setTripOdometer(int tripOdometer) {
        this.tripOdometer = tripOdometer;
    }

    /**
     * @return the gallonsOfGas
     */
    public double getGallonsOfGas() {
        return gallonsOfGas;
    }

    /**
     * @param gallonsOfGas the gallonsOfGas to set
     */
    public void setGallonsOfGas(double gallonsOfGas) {
        this.gallonsOfGas = gallonsOfGas;
    }

    /**
     * @return the milesPerGallon
     */
    public int getMilesPerGallon() {
        return milesPerGallon;
    }

    /**
     * @param milesPerGallon the milesPerGallon to set
     */
    public void setMilesPerGallon(int milesPerGallon) {
        this.milesPerGallon = milesPerGallon;
    }
    
    
}
